package nl.windgazer.arachne.services;

import nl.windgazer.arachne.services.externalsource.ManagedContent;

public interface ContentManagerService {

	/**
	 * Get content based on the path of a page and the 'key' (a unique identifier) for a specific piece of content.
	 * @param path Path of the current 'page' showing.
	 * @param key A unique identifier for the requested content-block.
	 * @return ManagedContent based on the path and/or the key. (Implementations may choose to ignore either value)
	 */
	public ManagedContent getContent(String path, String key);

	/**
	 * Get content based on a unique identifier, most likely a combination of the 'path' and 'key' parameters that
	 * are the most common way of accessing content from this service.
	 * @param uid A unique identifier matching what would be returned from the ManagedContent.getUID() method.
	 * @return ManagedContent based on the unique identifier.
	 */
	public ManagedContent getContent(String uid);

	/**
	 * Request the service to store a set of content-parts. Although not all implementations may choose to implement
	 * this method, it is the intend to create easy to edit content blocks. Essentially adding a rich editor which
	 * should allow specific users to edit a block of content and script / css.
	 * @param content A ManagedContent block.
	 * @return true is storing was succesfull, false if it was not.
	 */
	public boolean storeContent(ManagedContent content);

	/**
	 * A simple method to query a service to see if it is capable of storing new/edited content.
	 * @return true if it is capable of storing content.
	 */
	public boolean canStoreContent();
}
